ui: Add dev.perfetto.JournaldLog plugin and update AndroidLog (3/3)#5798
Open
staticfloat wants to merge 3 commits into
Open
ui: Add dev.perfetto.JournaldLog plugin and update AndroidLog (3/3)#5798staticfloat wants to merge 3 commits into
staticfloat wants to merge 3 commits into
Conversation
Author
|
Note that because |
a3afd08 to
0839611
Compare
Add a new `linux.journald` data source to `traced_probes` that reads log
entries from the systemd journal via `libsystemd`. The library is loaded
at runtime via dlopen("libsystemd.so.0") so there is no compile-time
dependency on libsystemd.
New protos:
- `JournaldConfig` in `protos/perfetto/config/linux/journald_config.proto`
- `JournaldEventPacket` in `protos/perfetto/trace/linux/journald_event.proto`
The data source opens the journal with sd_journal_open(), and emits one
JournaldEventPacket per entry containing: timestamp, pid, priority,
tag, message, uid, comm, systemd_unit, hostname and transport.
Refactor `AndroidLogTable` into a unified `LogTable` (`log_tables.py`, exposed as `__intrinsic_logs`) that stores log entries from all sources. A new log_source STRING column identifies the origin: 'android' or 'journald'. `LogTable` is moved out of `android_tables.py` into its own `log_tables.py` since it is no longer Android-specific. New linux_probes_parser.cc parses `JournaldEventPacket` and inserts into `LogTable` with log_source='journald'. Journald-specific metadata (uid, comm, systemd_unit, hostname, transport) is stored via `ArgsTracker`. Three SQL views are provided in the prelude: - logs: all entries from all sources - android_logs: convenience alias for log_source='android' entries - journald_logs: journald entries with metadata columns via extract_arg() Diff tests updated and a new Linux diff test suite covers journald parsing.
Add a new JournaldLog plugin (dev.perfetto.JournaldLog) that displays journald log entries from the linux.journald data source. The plugin shares UI components with the existing AndroidLog plugin, extracted into: - ui/src/components/tracks/log_track.ts: generic log track factory - ui/src/components/widgets/log_panel/log_panel.ts: shared LogPanel component with filtering, search, and per-source extensibility The AndroidLog plugin is refactored to use these shared components. This adds a new `Linux` section to the `Record new trace` page in the UI, adding the `linux.journald` datasource as the first section. In order to properly allow configuration of the minimum priority to capture, a `dropdown` widget is added.
0839611 to
7c2430b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new JournaldLog plugin (dev.perfetto.JournaldLog) that displays
journald log entries from the linux.journald data source. The plugin
shares UI components with the existing AndroidLog plugin, extracted into:
component with filtering, search, and per-source extensibility
The AndroidLog plugin is refactored to use these shared components.
Register dev.perfetto.JournaldLog in default_plugins.ts.
This is part 3 of a split-up version of #5331 and will close #3288.
This PR was co-written by AI; while I iterated on it until the look and feel felt correct, there may be context or use cases that I am unaware of. I am open to all review comments, and will do my best to address them.